<template>
  <view>

<my-login v-if="!userInfo.token"></my-login>
<my-userinfo v-else></my-userinfo>
  </view>
</template>

<script setup>
  import {moduleCart}  from '../../store/cart.js'
  import {onLoad,onReachBottom,onPullDownRefresh,onShow} from '@dcloudio/uni-app'
  import {moduleUser} from '../../store/user.js'
  const cartList=moduleCart()
  const userInfo=moduleUser()
  const setBadge=()=>{
    uni.setTabBarBadge({
      index:2,
      text:cartList.total+''
    })
  }
  
  onShow(()=>{
     setBadge()
  })

</script>

<style lang="scss">
page,
.my-container {
  height: 100%;
}
</style>
